package com.miniprogram.common.enums;

/**
 * 顾客角色枚举类
 *
 * @author lin
 * @since 2019年12月20日
 */
public enum StoreRoleTypeEnum {

    // 权益说明
    STORE_MANAGER("店长", 1),
    SHOP_ASSISTANT("店员", 2),
    WAITER("服务员", 3);

    private String description;

    private Integer code;

    StoreRoleTypeEnum(String description, Integer code) {
        this.description = description;
        this.code = code;
    }

    public static String getDescriptionByCode(Integer message) {
        if (message == null) {
            return null;
        }
        for (StoreRoleTypeEnum enumOne : StoreRoleTypeEnum.values()) {
            if (enumOne.getCode().equals(message)) {
                return enumOne.getDescription();
            }
        }
        return null;
    }

    public String getDescription() {
        return description;
    }

    public Integer getCode() {
        return code;
    }}
